UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4gHptRN6JxNYiwgjtCLCdfm51RHmpHckKqQHB3AQzJw=' 
WHERE 
  key_id = '5b740646c573ac8227957a59d8320f51ce8f9f017769da090d3477d3cf0bca25' 
  AND (
    token = '4gHptRN6JxNYiwgjtCLCdfm51RHmpHckKqQHB3AQzJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032