UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6q9tgmzRwIKUlLONepp2lJqt+ejyg/D6WIUB8qzjzAc='
WHERE
key_id = 'c00eff0a31b6231f24be386b8d7e21181f0f703b22e236c253bcfb21dc63d209'
AND (
token = '6q9tgmzRwIKUlLONepp2lJqt+ejyg/D6WIUB8qzjzAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)