/**
 * Implements hook_path_update().
 */
function {{ machine_name }}_path_update($path) {
  if ($path['alias'] != $path['original']['alias']) {
    \Drupal::database()->update('mytable')
      ->fields(['alias' => $path['alias']])
      ->condition('pid', $path['pid'])
      ->execute();
  }
}
