Developer tokens don't expire, but can be manually deleted from the security page of the user settings.
The extension API exists to create new kinds of tokens, so an extension could absolutely provide tokens with either a fixed or customizable expiration date.
If you have a use case for short-lived tokens, you might want to hit the Flarum REST API and manually create a regular session token that will expire in a few hours if it stops being used https://docs.flarum.org/rest-api#access-tokens