UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'taBmP+ki8rZuQeG/CC1cmJJ8E6koFTjBrSUNcIHGj8Q=' 
WHERE 
  key_id = '64b8e9f1d20770c8e2a622169ddbec07e244f8b5a0a21889fe36a661493cc506' 
  AND (
    token = 'taBmP+ki8rZuQeG/CC1cmJJ8E6koFTjBrSUNcIHGj8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029