The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi,
One addition, based on Microsoft's documentation for this setting:
"If you change the expiration time, existing links keep their current expiration time if the new setting is longer, or update to the new setting if the new setting is shorter."
So existing Anyone links aren't always left alone. The documentation doesn't spell out what happens to links that had no expiration at all, so I wouldn't assume either way.
I'd check a few of your older Anyone links. Open the file or folder, select Manage access > Links, and look at the expiration date shown for the link.
If older links must stop working regardless, remove them from Manage access.
Microsoft reference: Manage sharing settings for SharePoint and OneDrive