Hello , since you have mentioned a sprain, it may have been due to either long working hours on the laptop or due to sudden lifting of weight or even maybe a bad posture during the sleep. Cause could be any of the above or more, but a sore neck needs rest first.
Next Steps
You have mentioned there is pain on movement, so there maybe neck spasm which needs to be reduced by ice application around your neck. Ice pack needs to be rotated in circular fashion to bring down the spasm within. Hot packs need to be taken just before you sleep and in the morning when you first get up. This will relax the muscles.
Hope this small tip helps you.
Health Tips
And if the pain persists, you can visit your physiotherapist. Postural correction and exercises from a physiotherapist will help you prevent such injuries in the future.