UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '77Jg8/IsymvCsO6w2phU/Np+lV5KirTmpHNaxByjzXU='
WHERE
key_id = '03d2818db8a16991f1a1826dcefaa088b29313757ac1d7b4dda62837ed1826a5'
AND (
token = '77Jg8/IsymvCsO6w2phU/Np+lV5KirTmpHNaxByjzXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)