Its because of cervical muscle spasm and weakness+your lumbar muscle weakness. Muscles become weak due to prolonged use in sitting /travelling and lack of exercises.
Next Steps
Consult a physiotherapist.. Ultrasonic therapy +IFT/TENS +Heating therapy +some strengthening+stretching exercises will be helpful for sure.
Health Tips
At home.. Rest +hot water fomentation +pain killer gel +no long sitting /standing /walking /travelling /driving +no cold exposure +no manual exertions +no weight lifting +correct posture (sit tall) +no forward bending of neck and back.