UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wMUUP112XEeJ2cCof3k/leYsc+0gUrbp9S1f378oTWs='
WHERE
key_id = '01e2715cc5427f81a69cc60d7fce48989d53087bb923e373b5c44d968b3273de'
AND (
token = 'wMUUP112XEeJ2cCof3k/leYsc+0gUrbp9S1f378oTWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)