Section 21. The state treasurer shall invest such money in the name of the commonwealth, in bonds or other obligations of the commonwealth or in securities in which he is authorized to invest money in behalf of the commonwealth; and, on the first days of February and August in each year, he shall pay over the accrued interest thereof to the treasurer of any association owning a cemetery for the care, maintenance or improvement of which, or of any lot therein, the money has been deposited with him. If such cemetery is not owned by any association, such interest shall be paid to the town where the cemetery is located. At the time of paying such interest, the state treasurer shall inform the person to whom it is paid of the purpose to which it is to be applied, as stated in the copy of the instrument which is filed with him, and the person to whom it is paid shall apply it to such purpose.