UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SNBO3a3b2g0swXtRwqrqB/Wf4wWMQE+HiLlQ7FZectk='
WHERE
key_id = '46663cee9d30ff5b5efa39812ab0b5af09f8009b8982cfaa54194529e381fd2d'
AND (
token = 'SNBO3a3b2g0swXtRwqrqB/Wf4wWMQE+HiLlQ7FZectk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)