Hello~You could have a condition called "Sternocleidomastoid syndrome" this is a condition in which trigger points form in the SCM, leading to muscular pain and other symptoms. Trigger points are tight, sensitive areas of the muscle that can be caused by stress, poor posture, and neck injuries, among other causes. Have you tried putting ice on this area, this can help reduce the swelling.
I just wanted to add, I had this same issue a few days ago, mine hurt when I was sleeping or resting on my side, if I took a breath or moved my head, it felt like a spasm, I went to my chiropractor today and he could feel a big muscle knot, he worked on it and it is better but I still can sort of feel it. He showed me now to "pinch" or put pressure on that muscle, and it will relax. I asked him what was causing this, he said mainly stress, well, I am not surprised, my stress has been off the charts for a long time.
Anyway, I hope this helps, you might want to try the pressure point as well, plus some heat. I am sure it is nothing serious, mine isn't.