The content of a merchant's inventory, mineral veins, unlocked chests, etc are set when you get close enough and run the crosshairs over them. If you save before doing so you can reload repeatedly to try to get something good (with a merchant, their inventory will be reset the next time you level). I wouldn't waste too much time with this, except for maybe at the beginning of the game to get started with equipment, at chests, quests, malachite veins, or boss type opponents (save just before finishing them off), etc that always give something decent.
The contents of locked chests are determined when the chest is opened, regardless of whether you previously got close enough to examine / select it.