Use a Change node to set a context variable flow.alarmstatus using the output from mariadb.
Use a Switch node in your flow that sends a Telegram to only pass messages if flow.alarmstatus is "armed"
Note, if these are actually different flows either use global.alarmstatus or Link nodes so that flow.alarmstatus is both set and used in the same flow