Seems like MPDS and ankylosing spondylitis together creating TM Joint dysfunction due to stress which could be physical and mental both. A common picture of presentation in TMDs. You need a combination of position change exercises with some counselling and occlusal evaluation (and might be an appliance too). Visit a practice where specialist care is available lest it worsens.
Next Steps
visit a specialist who deals with TMDs
Health Tips
make sure the specialist deals with TMJoint Disorders routinely