It's actually quite easy to do on iOS 11. I have several Hue bulbs & Motion Sensors set up to do just that in my house.
Configure an automation to turn the lights on when the motion sensor does not detect motion. At the bottom of the configuration, set Timer to 30 minutes. The trigger ("does not detect motion") starts the automation ("turn the lights on") for the duration of the timer ("30 minutes"). Once the time is up, the light is turned off.
Now, this situation implies that the light would originally be turned on when motion is detected, so use this in tandem with an automation where it turns the lights on without any timer when motion is detected. Personally, there are some relatively rare cases where HomeKit misses the "does not detect motion" trigger, so I configure this automation with a timer of a much longer duration.