Filtering nodes shown on taxonomy menu block
Since you said you "would not mind temporarily touching the code" (I would highly advise not to touch and try to find alternative ways) here is my quick solution and also alternative ways of accomplishing it.

Assuming the field_expired is a boolean field (single on/off check-box values 1/0) and you are not using revisioning.(see the three lines I added), also make sure you resave at least one node to recalculate.

function _taxonomy_menu_term_count($tid) {
  $result = db_select('taxonomy_index', 'tn');
  $result-&gt;condition('tid', $tid);
  $result-&gt;join('node', 'n', 'n.nid = tn.nid AND n.status = 1');

  $result-&gt;join('field_data_field_expired', 'fdfe', 'fdfe.entity_id = tn.nid');
  $result-&gt;condition('fdfe.field_expired_value', '1', '=');
  $result-&gt;condition('fdfe.entity_type', 'node', '=');

  $result-&gt;addExpression('COUNT(n.nid)', 'term_count');
  $temp = $result-&gt;execute();
  $temp = $temp-&gt;fetchObject();
  return $temp-&gt;term_count;
}


Another ways of patching it would be to add a module_invoke_all higher up the code to allow other modules to interact (hook into), or use "addTag" along your query and allow other modules to alter the query itself (the latest one would be recommended). Both this require you to write your own custom module.