UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/xX1oYX3X9wpkYK+9CljpbSu4s9+c9wzVft7JzKTrU='
WHERE
key_id = '809243d07d3d220c79a80d7511a487b37ce1d27fda097bd8e990e23496b952f3'
AND (
token = 'a/xX1oYX3X9wpkYK+9CljpbSu4s9+c9wzVft7JzKTrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)