diff --git a/core/lib/Drupal/Core/Cache/ChainedFastBackend.php b/core/lib/Drupal/Core/Cache/ChainedFastBackend.php
index 9f6be9d8ab..fc57e4bf6c 100644
--- a/core/lib/Drupal/Core/Cache/ChainedFastBackend.php
+++ b/core/lib/Drupal/Core/Cache/ChainedFastBackend.php
@@ -149,7 +149,7 @@ public function getMultiple(&$cids, $allow_invalid = FALSE) {
       // are potentially invalid if older than the last time the bin was
       // written to in the consistent backend, so only keep ones that aren't.
       foreach ($items as $item) {
-        if ($item->created < $last_write_timestamp) {
+        if ($item->created <= $last_write_timestamp) {
           $cids[array_search($item->cid, $cids_copy)] = $item->cid;
         }
         else {
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
index a93b674d5c..5aa353b582 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
@@ -29,4 +29,60 @@ protected function createCacheBackend($bin) {
     return $backend;
   }
 
+  /**
+   * Tests that lastWriteTimestamp works as expected.
+   *
+   * @dataProvider dataLastWriteTimestamp
+   */
+  public function testLastWriteTimestamp($value_one, $value_two) {
+    $bin = 'test';
+    $consistent_backend = new DatabaseBackend(\Drupal::service('database'), \Drupal::service('cache_tags.invalidator.checksum'), $bin, 100);
+    $fast_backend = new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'));
+    $backend = new MarkAsOutdatedChainedFastBackend($consistent_backend, $fast_backend, $bin);
+    // Explicitly register the cache bin as it can not work through the
+    // cache bin list in the container.
+    \Drupal::service('cache_tags.invalidator')->addInvalidator($backend);
+
+    $backend->delete('test1');
+    $backend->set('test1', $value_one);
+    $item1 = $backend->get('test1');
+    $consistent_backend->set('test1', $value_two);
+    // Set the lastWriteTimestamp to the timestamp of the first entry.
+    $backend->setLastWriteTimestamp($item1->created);
+    $item2 = $backend->get('test1');
+    // We expect the value from the consistent cache.
+    $this->assertSame($value_two, $item2->data);
+  }
+
+  /**
+   * Data provider for dataLastWriteTimestamp.
+   *
+   * @return array
+   */
+  public function dataLastWriteTimestamp() {
+    $data = [];
+    for ($i = 0; $i < 20; $i++) {
+      $data['run ' . $i] = ['value1', 'value2'];
+    }
+    return $data;
+  }
+
+}
+
+/**
+ * Version of ChainedFastBackend that allows settings of getLastWriteTimestamp.
+ *
+ * @package Drupal\KernelTests\Core\Cache
+ */
+class MarkAsOutdatedChainedFastBackend extends ChainedFastBackend {
+
+  /**
+   * Sets the lastWriteTimestamp.
+   *
+   * @param $timestamp
+   */
+  public function setLastWriteTimestamp($timestamp) {
+    $this->lastWriteTimestamp = $timestamp;
+  }
+
 }
