Yes, they can! Sometimes to realign their jaws after eating, and sometimes for an unknown reason. Maybe just like other animals yawn.
But- do lizards yawn? I have never seen one do it. Or any other herp for that matter. So I would think the snake yawn is more a function of adjusting something in the mouth than sleep-related.