Create two systemd units and one script.

First unit runs `shutdown-no-user-sessions.service` once after 15min from the boot:

````
/etc/systemd/system/is-active-user-sessions.timer
[Unit]
Description=Start check if there is actvie user sessions

[Timer]
OnBootSec=15min
Unit=shutdown-no-user-sessions

[Install]
WantedBy=timers.target
````

Second unit starts your script to check logged users:

````
/etc/systemd/system/shutdown-no-user-sessions.service
[Unit]
Description=Shutdown if no actvie session

[Service]
Type=oneshot
ExecStart=script_to_check_user_logins
````
In your script parse output of `loginctl --no-pager list-users` or maybe even `who -q` and shutdown if there is no user sessions.