You can set an update period in the in the AppWidgetProviderInfo, however this doesn't support intervals smaller than 30mins. The proposed WorkManager workaround will also not work for intervals less than 15mins.
Frequent updates are not allowed because it would use too much power, sadly widgets are quite inefficient.
I suggest you read the guide on optimizing widget updates, but I don't think what you're trying to achieve is feasable.