For others who may be interested, you can use:
{$mybb->settings['bburl']}/misc.php?action=markread&fid={$mybb->input['fid']}&my_post_key={$mybb->post_code}
But you will need to use XThreads in order to use the if statement in templates.