Your mattress definitely could be causing the knot in your back or shoulder.
1. An old mattress could be the problem or part of the problem if it sags or has depressions.
Sometimes you can bolster up an old mattress by propping it from the bottom or padding the top. You might put a piece of plywood underneath or even move the mattress to the floor.
There are foam toppers that range from cheap to expensive. A flat one can be folded over to make twice as much padding where you sleep.
A NEW mattress could also be the problem if it doesn’t fit your body well. If it’s too firm, a foam topper will help. People with large-boned frames or wide hips need a place for the bones to go.
2. Do you always sleep on your side? The SAME side? That can do it, too, because you may be smashing your shoulder, tilting your neck, shortening your chest muscles and straining the muscles in your back on that side.
3. Side sleeping also strains the muscles of the lower back depending on how you are built. Propping your ribs between your hip bone and arm pit with a flat pillow or folded bath towel can help take the strain off your lower back muscles.
4. You might try sleeping on the sofa for a few nights you to tell if it makes a difference. Sometimes the couch is the best bed in the house. Some nights I shift back and forth from couch to bed just to give my body a change.
You might not be able to buy a new mattress but by changing the way you sleep or propping or fixing your current mattress you can start getting rid of the muscle knots in your back.