UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2jgnRB+J/5+YAEPuQZ5I04zgdwW5NfcXlQNpSBoenHw=' 
WHERE 
  key_id = '6aafebcd2bcb90e87f51b577325ca723fa771e6c9685c2f0ed6a83746741f1ae' 
  AND (
    token = '2jgnRB+J/5+YAEPuQZ5I04zgdwW5NfcXlQNpSBoenHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038