Bad backs are equally likely to be due to strains, caused by lifting heavy weights, as they are inactivity such as sitting for long periods in one position in the office or in a car.
When you feel able, try the following. I've personally found them excellent for preventing recurrences (and later have discovered they are exercises used by physios for bad backs).
1. On your hands and knees, arch up your back, aiming to rock slightly back and forwards. This helps stretch the upper and lower back after periods of inactivity (maybe do it when you get in from work?).
2. Lying on your back with your legs bent and feet on the floor, raise one bent leg so the knee approaches your hands, which then grab behind the knee and pull towards your torso. Repeat on the other side and then try with both legs.
3. Finally, the best thing I ever did was sit-ups. Always start with bent legs and tuck your toes under the edge of a chair to provide a brace and lift the shoulders only (it isolates the abdominal muscles more). When you get good, lie on your back, then lift both your shoulders and straightened legs off the floor, balancing on your bottom. Hands on your ears. Then pull both the legs in and torso up to meet the knees with the elbows. Don't pull the head with your hands as you might strain your neck.
The abdominal muscles oppose those of the lower back and when the latter get stronger, it causes the lower back to arch in an excessively concave fashion. Stronger abdominals will help pull that part of the torso straighter again.
For now, though, do try some Atrogel® 2-4 times a day and those stretching exercises.
Best wishes, I know how it feels.