UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wWeWMTt1g/cfxvPrAEgM2oGbUlRenBFPVfIVWn/vznA=' 
WHERE 
  key_id = 'f4b17023b30a70161cdcb3624dd16fb161ac5982ef62ceb8299af6f3cb052c53' 
  AND (
    token = 'wWeWMTt1g/cfxvPrAEgM2oGbUlRenBFPVfIVWn/vznA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018