I need to update a longblob value in the variable table using variable_set
With variable_set() you can set a persistent variable to any PHP value, including array. variable_set() will serialize the value passed as second argument, and variable_get() will unserialize that value. If you pass an array to variable_set() for a persistent variable, variable_get() will return an array for the same persistent variable (if another module doesn't change that persistent variable's value to an integer, for example).
Suppose that you want to change the value of node_revision_delete_minimum_age_to_delete_time, which is set from that module in its installation hook using the following code.
  $node_revision_delete_minimum_age_to_delete_time = array(
    'max_number' =&gt; 12,
    'time' =&gt; 'months',
  );
  variable_set('node_revision_delete_minimum_age_to_delete_time', $node_revision_delete_minimum_age_to_delete_time);

If you want to change max_number to 24, you would use code similar to the following one.
$node_revision_delete_minimum_age_to_delete_time = variable_get('node_revision_delete_minimum_age_to_delete_time', array());

if (is_array($node_revision_delete_minimum_age_to_delete_time)) {
  $node_revision_delete_minimum_age_to_delete_time['max_number'] = 24;
  variable_set('node_revision_delete_minimum_age_to_delete_time', $node_revision_delete_minimum_age_to_delete_time);
}