Recreate expires_at DB function to use new configurations