How to conditionally update and import nodes using Migrate? I need to migrate new nodes and update others in the same time. 2 installations of the same project are out of sync, which means, that the same nid may not indicate the same node on both sides. But I'm sure they're the same if their titles are equal. So I think, that I need a conditional field mapping, as illustrated in the following pseudocode: 

if source_nid = destination_nid
  if source_title = destination_title
    addFieldMapping('nid', 'nid')
else 
  continue


I have only one idea, how can I do this - split migrations into two different parts with filters managed by prepareRow() method (one of the for node updating, the other for import of new nodes). Is this the only way? I would appreciate something more elegant.
OK, at least now I know, that splitting migration into two with filtered rows works just fine. prepareRow function looks like this:

public function prepareRow($row) {
  // If node exists on destination
  if ($node = node_load($row-&gt;nid)) {
    // Use the metatdata wrapper to pull values
    $node_wrapper = entity_metadata_wrapper('node', $node);
    // If destination title is the same as source title
    if ($node_wrapper-&gt;label() == $row-&gt;title) {
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
  else {
    return FALSE;
  }
}