From your report it might be related to the muscle overstretching. If you have been sitting or staying for a while, your body is relaxed.
If you suddenly turn your head, it might cause over-stretching of the muscles causing sharp pain
However, I suggest to do
- Cardiac echo
- holter monitoring
to exclude heart problems.
I also advise to do regular stretching exercises regularly.
All the best!