This can be related to quite a few things. In the absence of other symptoms (like infection), the most common cause for jaw spasms that would cause it to feel like it's going to lock is related to a condition known as "TMJ" or "temporomandibular joint disorder." This particular joint is the joint that connect the lower jaw to the skull at the base of the ear. If you put your finger on your face right in front of your ear and open and close your jaw, you should be able to feel where this particular joint is located. Stress from chewing, talking, or grinding your teeth at night can affect structures of this joint: muscles, bone, the cartilage disk at the joint, nearby ligaments, blood vessels, and nerves, which results in painful inflammation. This inflammation can cause the joint not to work as smoothly as it should, and sometimes, even cause the discs in the joint to dislocate. In addition to pain and stiffness, you might also notice (and might not, depending on your case) popping sounds in the jaw, inability to fully open the mouth, jaw pain, headaches, toothaches, and various other types of pain in the face. Treatment for TMJ include:
- Good posture while at desks, or watching TV, and taking frequent breaks
- Consciously relaxing jaw muscles throughout the day
- Avoid eating hard foods or tough foods, and chewing gum
- Drink plenty of fluids to help lubricate the joints
- Moist heat or cold packs on the face
- Vitamin supplements, and joint supplements
- Exercise to help relaxation
- If you grind your teeth, invest in a mouth guard to use at night
- 600-800mg Ibuprofen (Motrin) every 6-8 hours as needed for pain and inflammation may help
If the spasms are quite severe and do not respond to any of the above, medical treatment will be necessary, and might include stronger pain medications, anti-inflammatory and steroid medications, muscle relaxers, arthritis meds. If there's any deformity in your jaw or tooth alignment, reconstructive procedures and/or surgery would be required as a last-resort when everything else fails.
Other causes might include a dental infection or abscessed tooth, in which the infection can affect the jaw or nearby nerves, and subsequently affect jaw function. Certain neurological disorders can cause jaw problems, tetanus, as well as use of certain medications can cause jaw stiffness as well. You mentioned that you have hypertension, and phenothiazines used to treat this do commonly cause jaw stiffness. You can see http://www.drugs.com/cons/Phenothiazines.html for a list of of phenothizine drugs that might cause jaw stiffness.
Treatment will depend on what's, specifically, causing this. A physical examination, blood tests, and, perhaps, imaging studies might be needed as diagnostic tests.
I hope this helps, and let me know if you have any further questions!