AMENDED AND RESTATED security agreement