diff --git a/expire.module b/expire.module
index 2657723..494fcb4 100644
--- a/expire.module
+++ b/expire.module
@@ -529,22 +529,21 @@ function expire_votingapi_delete($votes) {
  * Common expiry logic for votingapi.
  */
 function _expire_votingapi($votes) {
+  $cids = $nids = array();
   foreach ($votes as $vote) {
     if ($vote['entity_type'] == 'comment') {
-      $nid = db_query("SELECT nid FROM {comments} WHERE cid = :cid", array(':cid' => $vote['entity_id']))->fetchField();
-      if (is_numeric($nid)) {
-        $node = node_load($nid);
-        if ($node) {
-          expire_node($node);
-        }
-      }
+      $cids[] = $vote['entity_id'];
     }
     if ($vote['entity_type'] == 'node') {
-      $node = node_load($vote['entity_id']);
-      if ($node) {
-        expire_node($node);
-      }
+      $nids[] = $vote['entity_id'];
     }
   }
+  $nids = array_merge($nids, db_select('comments', 'c')
+    ->fields('c', array('nid'))
+    ->condition('cid', $cids)
+    ->execute()
+    ->fetchCol());
+
+  return array_map('expire_node', node_load_multiple(array_unique($nids)));
 }
 
