Hello~Sometimes an old mattress can cause this issue as it has lost its' firmness. I would definitely get the new mattress, if you feel better then great, no more worries, however, if it still continues after that, then I certainly would see your doctor.
You might also want to see a chiropractor, they are great for helping back pain, etc.
I hope you feel better soon.