There is a good possibility that you have tmj/tmd.
A jaw that locks (closed- limited opening, open- hard to close, ) is usually a sure sign of a disk that is displaced which is a major symptom of tmj. I would see a specialist. Try not to manipulate or force your jaw open or closed on your own. You can tear the disk and create a permanent injury. Don't try and fix yourself- could tear disk.