When should the inventory be updated

In a cart-based e-commerce website, users can add products to their basket and there can be a delay between that and the actual checkout. Considering multiple people can add products to their basket simultaneously, what is the suggested/appropriate time to update the products-in-stock number?

Should it be updated as soon as the product is added to the basket?

- If so, should there be a limit for how long the item can remain in the basket

OR

Should it be updated only after the user has made the payment and the checkout process is complete?