Hi, This could be related to mid portion of spine, where one of the joint might not be moving properly. And following muscle around that area also have got into Spasm.
Next Steps
Consult a Physiotherapist who can Manipulate the spine and also work on muscle
Health Tips
Meanwhile do ice pack around the area where it hurts.