UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0InlQkqxi61c0M5LkjDtg1dbYdMKwgJrw0HQDW2ukqM='
WHERE
key_id = '6e4975e3b1e8ae18cc5b2f4561805216a531e2bf52b32eb14c906db3ab5d09c7'
AND (
token = '0InlQkqxi61c0M5LkjDtg1dbYdMKwgJrw0HQDW2ukqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)