public function setCache(array $data)
    {
        $handle = $this->handle;

        $rows = $handle->query('SELECT created FROM `' . $this->config['table'].'`');

        if (!$rows || $rows->rowCount() === 0) {

            $this->write($handle, $data);
        } else {

            foreach ($rows as $row) {

                if ((time()-strtotime($row['created'])) >
                    $this->config['expiration_time']) {

                    $this->write($handle, $data);
                }
            }
        }

        return $this;
    }