UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gPqy0bkpRkCHUFTHBEH9Y+l0DmyTmrNesBkFxQP1qHM=' 
WHERE 
  key_id = '0e7c39158896519f55605a41e59c1333ce2789b72225ef4deecbab641cc42d59' 
  AND (
    token = 'gPqy0bkpRkCHUFTHBEH9Y+l0DmyTmrNesBkFxQP1qHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021