Saving or updating order in database

for example if paypal payment is canceled and the basket is changed, we
need to update the order in the database