php mysqli insert on dublicate : Greetings out there on the outerweb ;-)

Trying to make my life a little more easy, I descided to do a function for updating my tables with data.

I would like to have it done eg. like this:

    $table = "ticket_stati";
    $fields = array(`ticket_stati_id`, `locked_record`, `ticket_stati_name`, `ticket_stati_description`, `ticket_stati_color`);
    
    $data = array(1, 1, 'Open', 'The ticket is marked as open and not assigned or acked.', '#130a5a');
    // Call function
    func_update_table($table, $fields, $data);
    
    $data = array(2, 1, 'Assigned', 'The ticket has been assigned to a user or group', '#11a916');
    func_update_table($table, $fields, $data);

But I am having trouble figuring out how the _INSERT INTO_ should be created to make sure that on dublicate (ON DUBLICATE) only the fields with **updateable data** are updated.

Any one.