Since you seem to need a longer TTL for just a single record for your Ubiquiti controller, did you consider to define a host-record
with such a TTL in a custom dnsmasq
configuration file?
host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]
(...)
If the time-to-live is given, it overrides the default, which is zero or the value of --local-ttl . The value is a positive integer and gives the time-to-live in seconds.
(qouted from dnsmasq
man page)