Hello sir .
As per u Complaints . Its may be due to muscular spasm . It can be intense and pain may stay for long duration . Instead of taking medicine from medical store . I suggest u to visit orthopaedic . If u r not allergic to any kind of pain killers then u can take tablet aceclofenac 2 times daily . But before that u have to take tablet pantoprazol at empty stomach . And visit orthopaedic dr.
Next Steps
if u cant reach to dr. .. u can put ice pack on back where it hurts and when pain subside try to stretch legs and then other movements . do not try to move suddenly .