UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AoKUjE8/EdfubJQwo99gYcR2x9yA38pAKgOmgzvaut4='
WHERE
key_id = '7f0b71b78496c3bd2629f2bce79ccb38a1e65e1e9da8c63b436c3aef852390ef'
AND (
token = 'AoKUjE8/EdfubJQwo99gYcR2x9yA38pAKgOmgzvaut4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)