All withdrawals or reservations of public lands for the use of any agency of the Department of Defense, except lands withdrawn or reserved specifically as naval petroleum, naval oil shale, or naval coal reserves, heretofore or hereafter made by the United States, shall be deemed to be subject to the condition that all minerals, including oil and gas, in the lands so withdrawn or reserved are under the jurisdiction of the Secretary of the Interior and there shall be no disposition of, or exploration for, any minerals in such lands except under the applicable public land mining and mineral leasing laws: Provided, That no disposition of, or exploration for, any minerals in such lands shall be made where the Secretary of Defense, after consultation with the Secretary of the Interior, determines that such disposition or exploration is inconsistent with the military use of the lands so withdrawn or reserved.