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