UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XbIb7TzhWPZ30P4++XX/NozkskSvWdncr6LRWc+rqss='
WHERE
key_id = '4b57968d962a0df12091037fb2ba28433b33f1f61f3e433b963c9ac7ec9fae32'
AND (
token = 'XbIb7TzhWPZ30P4++XX/NozkskSvWdncr6LRWc+rqss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)