UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qpehLs/xBYygQSIIe81GGnGE6Rqy2v+MapxFfxSwZFc='
WHERE
key_id = 'b983f98aae287e9d955c0e8e656e900f58b1ada88c979b9f00ccbeab929092dc'
AND (
token = 'qpehLs/xBYygQSIIe81GGnGE6Rqy2v+MapxFfxSwZFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)