UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lk+UiFZV2Iraus6NfZvorxYnVkHmK9Wa6IgjCWAVVDQ=' 
WHERE 
  key_id = 'ec7b0a795e91c36305118e99333e66aeef09271c76e52c38d3e354b24791ca5c' 
  AND (
    token = 'lk+UiFZV2Iraus6NfZvorxYnVkHmK9Wa6IgjCWAVVDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030