UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '848Hny/2UyMXM46P0M216PWYrIRqX/BEPn996rH2NUQ=' 
WHERE 
  key_id = '746500bf95a11d80d03ff0a8ef87f26fc61bb6748d2573e9e6bbc60d7aeae5e4' 
  AND (
    token = '848Hny/2UyMXM46P0M216PWYrIRqX/BEPn996rH2NUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022