UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EGv61xy6xdaYIQBOHYeJUp8kCkuYwoAj/brUZo7BQ9Y=' 
WHERE 
  key_id = '62b991114def3bf71bbcf7fba149def3c57290904454fcdea0c0c730637c8fb0' 
  AND (
    token = 'EGv61xy6xdaYIQBOHYeJUp8kCkuYwoAj/brUZo7BQ9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051