Thats exactly what is happening.

An anxious and stressed person is a tense person. You are tensing your muscles subconsciously which is causing the pain.

Its exactly the same reason I get headaches. I wake without them and by the end of the day I have a headache. Because I've walked around all day with my shoulders hunched and neck held tight.