UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggSuClo9Uikm69O8WWQLIuXYuAZbdWpeXPgwDd+V/8k=' 
WHERE 
  key_id = 'e0e875faa32ed703eb9887217ab8a59cca5bc34c0d3841f7c46ec1ca7759a492' 
  AND (
    token = 'ggSuClo9Uikm69O8WWQLIuXYuAZbdWpeXPgwDd+V/8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040