UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hlg7vVEdXoaAtpbhOeYFuviEfpfM1vn0Lum/BAbEgeM=' 
WHERE 
  key_id = '37911dc7bdfd84a996f0d43d64d7a20ea9ce6391b05320843e956033f58a16d4' 
  AND (
    token = 'Hlg7vVEdXoaAtpbhOeYFuviEfpfM1vn0Lum/BAbEgeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032