Concat Null Variables in Insert Query of Action Button

I am filtering some values from a table and try to store those information in another table using an action button. I have three variables to filter - account_type, gender and is_enabled. These variables are optional and user will be able to select only the desired attributes.
I want to store these information inside one column in the new table like this.

account_type='savings',gender='female',is_enabled=true

The insert query I used for this is:

INSERT INTO new_table (
   query,
   created_at,
   updated_at
) VALUES (
   CONCAT(
  'account_type = ', {{account_type}}, 
   'gender = ', {{gender}}, 
   'is_enabled = ', {{is_enabled}}),
   NOW(3),
   NOW(3))

This works fine if the user inputs all the variables. But the problem is if a user doesn't input a variable I have to handle it in the query. I tried something like this.

CONCAT(
  IF {{account_type}} != 'NULL', CONCAT('account_type = ', {{account_type}}, ''),
   IF {{gender}} != 'NULL', CONCAT('gender = ', {{gender}}, ''),
   IF {{is_enabled}} != 'NULL', CONCAT('is_enabled = ', {{is_enabled}}, ''))

But this gives an error in the if condition. Can someone help me to resolve this issue?