Hii...
Your muscle spasm may be because of an incorrect posture during lactating & it is very common in lactating women. Whenever you maintain an incorrect posture for a long time , your muscles will be go into the spasm and it will produce pain & stiffness.
Next Steps
Consult to physiotherapist and learn an isometric exercises and stretching exercises for neck and back muscles.And do hotpack before or after exercises
Health Tips
Maintain proper posture , correct baby holding technique, do isometric exercises adviced by your Physiotherapist.Do it atleast once in a day.