UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MMRhaXfA/lAPpyxgUa/z6xQQSRgM5+/L4JhNcmDOPhY='
WHERE
key_id = '6aa96d58c9ddcf2f4f7cdbdbc063915fe9cf1463dd2ec5a53db5d69fde1e0f3f'
AND (
token = 'MMRhaXfA/lAPpyxgUa/z6xQQSRgM5+/L4JhNcmDOPhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)