They can survive a couple days out of the water. Keep them in a cool, dark, damp place overnight. A bushel basket with a wet burlap sack over it will keep them alive pretty well overnight as long as it is kept pretty cool (60-70 degrees or so). As long as their gills can stay wet they will survive but be sure they cant get into any standing water or they will all die.
Definitely do not cook and eat dead crabs
Edit: A cooler should work ok.
This is MUCH easier said than done.