Query posts by custom taxonomy and sort by post_modified

The WP_Query function can be used on custom taxonomies and post types and is probably easier than querying the database directly. The following should do what your looking for:

<?php $query_hot = new WP_Query( array(
    'post_type' => 'vacancy',
    'field' => '18', // You can use the ID or slug here
    'orberyby' => 'modified',
    'posts_per_page' => 5
)); 
while($query_hot->have_posts()) : $query_hot->the_post(); ?>

     <!-- Whatever you want to show in your loop -->

<?php endwhile; wp_reset_postdata(); // reset the query ?>

See the Codex article on WP_Query for more.