UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wvAuIup0D0iE7SzPmB4uoFE3/e4VN4+z1fkm9cvSLSM=' 
WHERE 
  key_id = '67ba443351673294fe6204b8a971ebef5256545636f2023360e08ce057c27b03' 
  AND (
    token = 'wvAuIup0D0iE7SzPmB4uoFE3/e4VN4+z1fkm9cvSLSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038