The lyric “shake it like an earthquake” appears in “Shake It” by Metro Station (2007), not The Black Eyed Peas. The Black Eyed Peas have a song titled “Shake It” (2005), but its lyrics differ.
Metro Station – “Shake It” (key lyric):
“Shake it like an earthquake, watch you shake it...”
Correction: The original answer misattributed the song.