Muscle spasm has many reasons . Like habit, posture , PIVD, trauma and infection etc. there is insufficient information regarding muscle spasm . Any muscle relaxant like tolperisone, thiocholchicoside, or eperisone etc along with pain killer can do better but you will get best result with Physiotherapy and exercise once pain subsides.
Next Steps
For further consultation regarding your symptoms you can consult online or reach clinic.