UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VTxEtnito6NbBIkpYWnceuCtIgM5pEjY4c2m8UDfuJs=' 
WHERE 
  key_id = '3532e43e3973f3c7576d83247f7e57ffbe4dcf8132d98226b821f96aebf0a026' 
  AND (
    token = 'VTxEtnito6NbBIkpYWnceuCtIgM5pEjY4c2m8UDfuJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025