UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ASy+sF8CB4iUYpjPmbHcVuoPcnRYuMc1vSLVa981IUs='
WHERE
key_id = '5fc353ec85c788dc72fe02d1286851cf0c328be159ed4f5924b2089a54077a65'
AND (
token = 'ASy+sF8CB4iUYpjPmbHcVuoPcnRYuMc1vSLVa981IUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)