UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X1kW8bV/QB94mFBb2InRvHT9ysA2JL0qnOvl7qJHq5k='
WHERE
key_id = '757e228fb67020a4108e8f23a1f4b30b30ed6761ffbed5e8cd1b2a084a471634'
AND (
token = 'X1kW8bV/QB94mFBb2InRvHT9ysA2JL0qnOvl7qJHq5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)