UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QorwQ7xJ3eQE0Kr5FecSlYHb4/TTK+0ZzfbP34FS/DQ='
WHERE
key_id = 'a97d0bcf013710befb47dd132d4ff34c16083ab1064e0703ab69db4c0db5173f'
AND (
token = 'QorwQ7xJ3eQE0Kr5FecSlYHb4/TTK+0ZzfbP34FS/DQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)