UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3NqEI/C4wIZtsnNPgBtFS1iqOV8WWWFPKxLEDGhKW6g=' 
WHERE 
  key_id = '3451f4c90b02cf9bf57b4ece4b4cd1bafac2066c975d1139ebf509410546cd13' 
  AND (
    token = '3NqEI/C4wIZtsnNPgBtFS1iqOV8WWWFPKxLEDGhKW6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027