Any part of any deposit of an insurer held by the commissioner which is in amount in excess of the deposit required or permitted to be made by such insurer under this code, shall, upon written order of the commissioner, be released; except, that no deposit held on account of any registered policies heretofore issued by the insurer shall be released except in accordance with the conditions under which such deposit was made.