Pass variables through AJAX callback and update MySQL database
I actually managed to do it! For anyone that may have a similar problem this is what I did.
First of all, I took the url parameters using parse_url and did the following

$parts =  parse_url($_path);
parse_str($parts['query'], $query);
$first = $query['first'];
$second = $query['second'];


,then put those variables as form default values, that I will hide using css:

$form['user_id'] = array (
         '#type' =&gt; 'textfield',
         '#title' =&gt; t('User id'),
         '#description' =&gt; t('user id'),
         '#default_value' =&gt; $first,
);


Then, on my callback function I take those variables, for example:

$_first = filter_xss($_values['first']);


and then I used db_update:

$num_updated = db_update('unsubscribed_users')
    -&gt;fields(array(
        'reason' =&gt; $_reason,
      ))
    -&gt;condition('first', $_first , '=')
    -&gt;condition('second', $_second , '=')
    -&gt;execute();