UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nturzxcbeCWpJl242Fhzz6RP0JtdaFz0UHZjekNStDg=' 
WHERE 
  key_id = '0e5ba93e29669b8e2c64f79553af276924aff7ce763bd03c4061b4d0716d0989' 
  AND (
    token = 'nturzxcbeCWpJl242Fhzz6RP0JtdaFz0UHZjekNStDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031