SECOND AMENDED AND RESTATED Loan and security agreement