UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7QFmPlhBkxOMycOFg+wJIR0killKx3L1GATxaS5ElrE='
WHERE
key_id = '83982c1ad9d3efb35aed7effafd185b9a484c08baae966117e45dd68f8ce16e3'
AND (
token = '7QFmPlhBkxOMycOFg+wJIR0killKx3L1GATxaS5ElrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)