UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZOX7X1LGmrwWYgVKt8rw+QSHtXQRJa79LJ/k+xH8yOg='
WHERE
key_id = '0534ff03b3962145c223a463e354afe6da62069b1ea57b34080a6ae3cad3d2c0'
AND (
token = 'ZOX7X1LGmrwWYgVKt8rw+QSHtXQRJa79LJ/k+xH8yOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)