UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sGbj2RsM6yuF2E4kaHyWIpt5OvEoB4SAFz2o6YFEDtM=' 
WHERE 
  key_id = 'ac150a00ef1550b8c4df2239c6638c12ef3eb8fda4bb56cd358967715c73616a' 
  AND (
    token = 'sGbj2RsM6yuF2E4kaHyWIpt5OvEoB4SAFz2o6YFEDtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016