UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PXMwBkx1ExJa4XJFf1/vMbPffvF8wfyrMvW0xrSrqpk='
WHERE
key_id = '8099f566b9d685c8a35665a379c8ed24748a432ca9999feddce2676674529535'
AND (
token = 'PXMwBkx1ExJa4XJFf1/vMbPffvF8wfyrMvW0xrSrqpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)