Except as otherwise ordered by the court, if property levied upon is subject to a security interest which attached prior to the levy, the property or obligation is subject to enforcement of the security interest without regard to the levy unless the property is in the custody of the levying officer. If the attachment lien has priority over the security interest, the secured party is liable to the plaintiff for any proceeds received by the secured party from the property to the extent of the attachment lien. After the security interest is satisfied, the secured party shall, to the extent the defendant would have been entitled, deliver any excess property and pay any excess payments or proceeds of property remaining in the secured party's possession to the levying officer for the purposes of the levy, unless otherwise ordered by the court or directed by the levying officer. (CCP 488.600)