UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iHPdIwjBLMCEStLEIFl7YQ5glaRCCitDmK38ZyW9I1g=' 
WHERE 
  key_id = '434b3b7f9fc73d316e06471247bcc081cc64909540cea98e5b24082e93c6017b' 
  AND (
    token = 'iHPdIwjBLMCEStLEIFl7YQ5glaRCCitDmK38ZyW9I1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025