UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZnGK/wwtBL+1NM0xfG5Hi4t6iFqh+p8RHGwMPu0PynM=' 
WHERE 
  key_id = '858cbf02216cb20cf34acaa34d1af55c9bd272cd5ac03f61ce5636e509352a18' 
  AND (
    token = 'ZnGK/wwtBL+1NM0xfG5Hi4t6iFqh+p8RHGwMPu0PynM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033