AMENDED AND RESTATED STOCK PURCHASE AND RESTRICTION AGREEMENT