UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6yHmzq1ImNh/yhpYAiR76JpXPoW7iAYPRCcwly4sTa8=' 
WHERE 
  key_id = '45ab91fcf8a222a270538f5ec4611c1795c13519ab8a315ee0c71139b69868f8' 
  AND (
    token = '6yHmzq1ImNh/yhpYAiR76JpXPoW7iAYPRCcwly4sTa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022