Yes matress and siting posture can both affect your back.
You need someone to take you through an ergonomic assessment and treatment.
Any specific exercise program needs a proper assessment.
Next Steps
some basic advices are:
sit right back into the chair
take breaks every 40 mins or so
With the thoracic spine, arm movments mobilise the spine so bend elbow lifts and bringing them into your chest would do some low grade self mobilisation. twists in sitting are really important to. 15 reps of each at least 3 times is atleast could be a start in self mobilisation.
Health Tips
sitting too long in a fixed position puts undue pressure on your disc....