When there are proceeds of sale belonging to an unknown owner, or to a person without the state who has no legal representative within it, or when there are proceeds arising from the sale of an estate subject to the prior estate of a tenant for life or years, which are paid into the court or otherwise deposited by order of the court, the same shall be invested in securities on interest for the benefit of the persons entitled thereto.