UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5/tTl/AO7k4XnTHFxOVykMyEiL/hdvlMID/zxyAtBDc=' 
WHERE 
  key_id = '3695b361a389e1c7fe11b3d0219dc7c58eeefdcc35b9a9a91f85f2748ea8b9ae' 
  AND (
    token = '5/tTl/AO7k4XnTHFxOVykMyEiL/hdvlMID/zxyAtBDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025