I have a table in my web app for storing session data. It's performing badly, and I can't figure out why. Slow query log shows updating a row takes anything from 6 to 60 seconds.

```sql
CREATE TABLE `sessions` (
    `id` char(40) COLLATE utf8_unicode_ci NOT NULL,
    `payload` text COLLATE utf8_unicode_ci NOT NULL,
    `last_activity` int(11) unsigned NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `session_id_unique` (`id`) USING HASH
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

```

The PK is a `char(40`) which stores a unique session hash generated by the framework this project uses (Laravel).

(I'm aware of the redundancy of the PK and unique index, but I've tried all combinations and it doesn't have any impact on performance in my testing. This is the current state of it.)

The table is small - *fewer than 200 rows*.

A typical query from the slow query log looks like this:

```sql
INSERT INTO sessions (id, payload, last_activity) 
VALUES ('d195825ddefbc606e9087546d1254e9be97147eb', 
        'YTo1OntzOjY6Il90b2tlbiI7czo0MDoi...around 700 chars...oiMCI7fX0=', 
        1405679480) 
ON DUPLICATE KEY UPDATE 
    payload=VALUES(payload), last_activity=VALUES(last_activity);

```

I've done obvious things like checking the table for corruption. I've tried adding a dedicated PK column as an auto increment `int`, I've tried without a PK, without the unique index, swapping the `text` column for a very very large `varchar`, you name it.

I've tried switching the table to use MyISAM, and it's still slow.

Nothing I do seems to make any difference - the table performs very slowly.

My next thought was the query. This is generated by the framework, but I've tested hacking it out into a `UPDATE` with an `INSERT` if that fails. The slowness continued on the `UPDATE` statement.

I've read a lot of questions about slow `INSERT` and `UPDATE` statements, but those usually related to bulk transactions. This is just one insert/update per user per request. The site is not remotely busy, and it's on its own VPS with plenty of resources.

What could be causing the slowness?