UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x1uxIZj4q7SFAanELeyAkSPIFI0WppzehwQmEgDGCW0=' 
WHERE 
  key_id = '35bcb6ac6515f809eb706fbad590c5a6f93edf63ac215c189352e09a42b858ee' 
  AND (
    token = 'x1uxIZj4q7SFAanELeyAkSPIFI0WppzehwQmEgDGCW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034