diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index 100ef68..6c504e3 100755
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -1111,7 +1111,13 @@ public function rollBack($savepoint_name = 'drupal_transaction') {
         if (empty($this->transactionLayers)) {
           break;
         }
-        $this->query('ROLLBACK TO SAVEPOINT ' . $savepoint);
+        try {
+          $this->query('ROLLBACK TO SAVEPOINT ' . $savepoint);
+        } catch (PDOException $e) {
+          if ($e->errorInfo[1] != '1305') {
+            throw $e;
+          }
+        }
         $this->popCommittableTransactions();
         if ($rolled_back_other_active_savepoints) {
           throw new TransactionOutOfOrderException();
