AMENDMENT NO. 2 TO AMENDED AND RESTATED SECURITIES PURCHASE AGREEMENT