Rigor Mortis is caused by a breakdown in the structure of the muscle tissue which releases calcium inside the muscle cells. That stimulates muscle contraction and because the animal is dead, it doesn't have the ATP necessary to relax the muscles. It happens very suddenly, which gives rise to the stories of dead people "sitting up", etc.
It only lasts a short while because the muscle fibers begin to break down and the contractile filaments inside begin to be destroyed, causing the muscles to relax again.
It does occur in snakes. I have actually watched it happen in a dead Tropidodipsas fasciatus (Banded Snailsucker?). I was trying to take a photo of a roadkill that I had picked up and put in the cooler overnight. When I set it out in a "lifelike" pose it suddenly started going into rigor mortis and its body moved around violently before stiffening in a very "unlifelike" position after about 60 seconds. It was very strange to watch a very dead snake twisting about like that, opening its mouth like it was in its "death throes".
-----
Chris Harrison
San Antonio, Texas