AMENDED AND RESTATED SECURITY AND PLEDGE AGREEMENT