When the tide is out, the bivalve Geukensia granosissima (family Mytilidae) shuts is valves tight and waits for the return of the water1. I photographed these individuals at low tide in a small clump of mangroves near Tampa, Florida. The one on the left with gaping valves was dead. I had to pull hard to remove the one on the right; the byssal threads of its byssus (arrow) had attached it quite securely to the sand.
These mussels can survive outside the sea in their tightly closed shells presumably for many hours. I think if bivalves had a mechanism of locomotion that would work on land, some of them would have long ago evolved to become terrestrial.
1I am grateful to Trish Hartmann, author of The Bivalve Seashells of Florida, for helping me with the identification.