UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7J/YPSBm8qCHqLYrPk0QqPGArsr9hs90vNm2UQ+TNn0=' 
WHERE 
  key_id = '32b4be82bc55ed1a4b98ef2d1a8cd8fcf8283eb6d3c97a1c0663b1bd92ea0593' 
  AND (
    token = '7J/YPSBm8qCHqLYrPk0QqPGArsr9hs90vNm2UQ+TNn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023