I just tested this simple trick, and it worked:
1) Create your first file ToBeUpdated.txt
2) In your OneDrive, share that file (create a anyone can view link)
3) Create your second file Newer.txt
4) In cmd.exe prompt, copy Newer.txt ToBeUpdated.txt (just copy the newer "on top of" the previous file, effectively replacing the file)
5) Wait for the OneDrive file Status to update. Now the file is updated but the share link remains the same!
I also found out that the same work by doing it in Explorer (copy/move from another folder to overwrite with the same filename). (FYI some other programs work so that they first delete the file and then save the file, in which case the link is lost.)