You could store the last generated number in an entity. When you build the next serial number retrieve this, increment it, store it, and then use it in the serial number.
You will probably want to protect this entity by providing this functionality via a dedicated microflow that has concurrency disallowed.
You could create an entity with 1 Attribute: Autonumber.
Every time you need to generate a new unique code you can create 1 of that object( no need to commit the object).
The value of that Autonumber attribute can then be used to create your unique code:
MyUniqueValue = ‘SL1_UP_31032021_’ + toString($TheAutonumberAttribute)