In all cases where the state of Minnesota shall execute any patent or conveyance of lands under any land grant heretofore made to any railroad company to aid in the construction of any railroad there shall be expressly reserved to and retained in the state of Minnesota all the iron, coal, copper, gold, and other valuable minerals in or upon all such lands and the commissioner of management and budget is hereby prohibited from executing or delivering any patent or instrument of conveyance which shall not contain the reservations aforesaid.