Hi @frob ,
Please try to do this:
1.Login to SharePoint Admin Center site at:
2.Click on the “Policies” and then the “Sharing” link in the left navigation.
3.On the Sharing page, expand the “More external sharing setting” and enable the checkbox “Guest access to a site or OneDrive will expire automatically after this many days” and then set the number of days.