SECOND AMENDMENT TO AMENDED AND RESTATED CREDIT AGREEMENT AND AMENDMENT TO SECURITY AGREEMENTS