Hi, greetings
1st of all the kind of history you are giving it seems you have TMJ problem which means the joint between your jaw and skull. as you say sometimes your jaw gets locked clearly indicating you have some joint issues and regarding piercing in your tongue, it can aggravate your problem if you open your mouth for a longer duration as it creates more pressure on your jaw joint. as of now, you can do warm fermentation on the joint near your ears 5- 20 minutes near the joint and can take a muscle relaxant and restrict your diet to soft food only for few days. IF problem persists better get a professional opinion because you might require some special X-rays and scan to see the problem. As of now TMJ problems are quite common. with precaution and prevention, you will get better. so don't worry a great deal.
regards,
Dr.PARAS
Next Steps
If problem persist for a week better see a dentist
Health Tips
hot fermentation with hot towel on joint area, warm saline rinses, muscle relaxant.