Thank you Sonja, for the information.
There are different causes of muscle cramps.
Usually cramps are felt mostly in the limbs. But any muscle of the body can be affected.
Deficiency of calcium, magnesium, potassium, sodium- vitamins, dehydration etc. are the major factors.
Poor circulation or nerve involvement like dystonia, MS etc. also can cause muscle spasm.
It can also be present in diabetes, hypothyroid state.
Sometimes no cause can be apparent too.
When you had pain in the back, a nerve impingement is possible.
I would suggest to have an examination by neurologist.
You can have tests to see if there is any deficiency state.
Correction of those can help.
You may try some home measures-
Please take plenty of fluid, fruits, vegetables .
Regular exercise or a walk daily to keep you active.
Stretching or gentle massage can be helpful.
Avoid coffee, alcohol, tobacco
etc, if you take any.
I hope this information helps.
I will be happy to assist, if you need any clarification.
Please feel free for any follow up query.