UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfKRaPAZsDQtoN9uWzxzyAZchVl6G1XyTWtUnB4lR/A=' 
WHERE 
  key_id = '60331e8de59f03259b80ef31b858e4bf18336cc470349bc154676ac374d3b4b8' 
  AND (
    token = 'MfKRaPAZsDQtoN9uWzxzyAZchVl6G1XyTWtUnB4lR/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041