UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aVM2zoQyCxX+ru/KjMYnurrn2r7mtV6+EEm3b5zHlFQ='
WHERE
key_id = 'c492eb8844acc5a0f26f0265b62bae11d8624bee244f8793a0c6f0b8209ee4bb'
AND (
token = 'aVM2zoQyCxX+ru/KjMYnurrn2r7mtV6+EEm3b5zHlFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)